package com.sny.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

/**
 * @Author:yangxupeng
 * @Description:
 * @Date: 2020/7/30 4:20 下午
 * @Modified:
 */
@Table(name = "fms_file_storage")
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FileStorageModel extends BaseModel {
    /** 自定义文件名 */
    @Column(name = "name")
    private String name;

    /** 上传时文件本身名称 */
    @Column(name = "filename")
    private String filename;

    /** 存储地址 */
    @Column(name = "url")
    private String url;

    /** 描述 */
    @Lob
    @Basic(fetch = FetchType.EAGER)
    @Column(name = "description",length = 3000)
    private String description;

    /** 尺寸 */
    @Column(name = "size_num")
    private Long size;

    /** 上传IP地址 */
    @Column(name = "ip_addr",length = 64)
    private String ipAddr;

    /** 文件后缀 */
    @Column(name = "suffix",length = 20)
    private String suffix;

    /**MD5码*/
    @Column(name = "md5",length = 225)
    private String MD5;

    /** 上传用户 */
    @Column(name = "user_name")
    private String userName;

    /**
     * appid
     */
    @Column(name = "app_id",length = 20)
    private String appId;
    /**
     * 文件id
     */
    @Column(name = "file_id")
    private String fileId;

    /**
     * 存储dir
     */
    @Lob
    @Column(name = "storage_dir")
    private String storageDir;
}
